﻿//# sourceURL=wisej.web.ext.Syncfusion2Widget.FileManager.js

///////////////////////////////////////////////////////////////////////////////
//
// (C) 2020 ICE TEA GROUP LLC - ALL RIGHTS RESERVED
//
// 
//
// ALL INFORMATION CONTAINED HEREIN IS, AND REMAINS
// THE PROPERTY OF ICE TEA GROUP LLC AND ITS SUPPLIERS, IF ANY.
// THE INTELLECTUAL PROPERTY AND TECHNICAL CONCEPTS CONTAINED
// HEREIN ARE PROPRIETARY TO ICE TEA GROUP LLC AND ITS SUPPLIERS
// AND MAY BE COVERED BY U.S. AND FOREIGN PATENTS, PATENT IN PROCESS, AND
// ARE PROTECTED BY TRADE SECRET OR COPYRIGHT LAW.
//
// DISSEMINATION OF THIS INFORMATION OR REPRODUCTION OF THIS MATERIAL
// IS STRICTLY FORBIDDEN UNLESS PRIOR WRITTEN PERMISSION IS OBTAINED
// FROM ICE TEA GROUP LLC.
//
///////////////////////////////////////////////////////////////////////////////

/**
 * Pre-process the Widget configuration.
 * @param {any} options
 */
this.filterOptions = function (options) {

	options.height = "100%";

	if (!options.ajaxSettings) {
		var serviceUrl = this.getServiceUrl();

		options.ajaxSettings = {
			uploadUrl: serviceUrl + "?action=Upload",
			url: serviceUrl + "?action=FileOperations",
			downloadUrl: serviceUrl + "?action=Download",
			getImageUrl: serviceUrl + "?action=GetImage",
		};
	}
}

// Returns a data map that can be converted to JSON.
this.filterEventData = function (args) {
	var data = {
		type: args.name
	};
	switch (args.name) {
		case "fileSelect":
			data.action = args.action;
			data.fileDetails = args.fileDetails;
			data.isInteracted = args.isInteracted;
			break;

		case "menuClick":
			data.item = args.item.text;
			data.fileDetails = args.fileDetails;
			break;

		default:
			break;
	};

	return data;
}
